/**
 * Created by IntelliJ IDEA.
 * User: scotthatcher
 * Date: Mar 24, 2010
 * Time: 2:44:17 PM
 * To change this template use File | Settings | File Templates.
 */
import acm.program.*;

public class DeletingCharacters extends ConsoleProgram {


    public String removeAllOccurrences(String str, char ch){
        String Output = "";
        for (int i = 0; i<str.length(); i++){
            char givenCharacter = str.charAt(i);
            if (givenCharacter != (char)ch){
                Output = Output + givenCharacter;
            }
        }
        println (Output);
        return(Output);
    }


    public void run(){
        String str = readLine("Enter your string: ");
        char ch = 'i';
        removeAllOccurrences(str,ch);
    }

}
